<template>
    <div class="goods-desc">
        <h3>{{desc.title}}</h3>
        <div v-html="desc.content" class="content">
            
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                id: this.$route.params.id,
                desc : {}
            }
        },
        created () {
            this.getDesc();
        },
        methods: {
            getDesc(id) {
                this.$http.get('http://vue.studyit.io/api/goods/getdesc/'+this.id).then(result=>{
                    if( result.body.status === 0 ) {
                        this.desc = result.body.message[0];
                    }
                    console.log(this.desc);
                });
            }
        }
    }    
</script>
<style lang="less">
.goods-desc{
    padding: 4px;
    h3{
        font-size: 16px;
        color:#226aff;
        text-align: center;
    }
    .content {
        img{
            width: 100%;
            height: auto;
        }
        
    }
}
</style>
